package com.ahau.springcloud.Config;

import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

/**
 * @Author xiao hu die
 * @Date 2021/11/29 22:11
 * @Version 1.0
 */
/**标注它为一个配置类*/
@Configuration
public class ApplicationContextConfig {
  /**生成一个restTemplate的方法*/
  /**注入到Ioc容器中*/
  @Bean
  @LoadBalanced/**提供负载均衡能力*/
 public RestTemplate restTemplate(){
  return new RestTemplate();
}
}
